home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / mmdf / mmdf-IIb.43 / uip / snd / s_onint.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-03-12  |  1.1 KB  |  80 lines

  1. /* name:
  2.     onint, onint2, onint3
  3.  
  4. function:
  5.     to take appropriate actions before terminating from a del.
  6.  
  7. calls:
  8.     exit
  9.  
  10. called by:
  11.     input
  12.  
  13. */
  14.  
  15. /*
  16. **    R E V I S I O N  H I S T O R Y
  17. **
  18. **    03/31/83  GWH    Split the SEND program into component parts
  19. **            This module contains : onint, onint2,
  20. **            onint3, confirm.
  21. **
  22. **    10/05/83  GWH    Fixed s_exit so that the draft file will not be
  23. **            removed in abnormal terminations.
  24. **
  25. */
  26.  
  27. #include "./s.h"
  28. #include "./s_externs.h"
  29.  
  30. sigtype
  31. onint ()
  32. {
  33.     printf (" XXX\n");
  34.     fflush (stdout);
  35.     signal (SIGINT, onint);
  36.     truncate( tmpdrffile, 0);
  37.     if (inrdwr)
  38.     aborted = TRUE;
  39.     else
  40.     longjmp (savej, 1);
  41. }
  42.  
  43. sigtype
  44. onint2 ()
  45. {
  46.     printf (" XXX\n");
  47.     fflush (stdout);
  48.     s_exit (-1);
  49. }
  50.  
  51. sigtype
  52. onint3 ()
  53. {
  54.     signal (SIGINT, onint3);
  55.  
  56.     if (body)
  57.     longjmp (savej, 1);
  58.  
  59.     s_exit (0);
  60. }
  61.  
  62. confirm ()
  63. {
  64.     char answer[32];
  65.  
  66.     printf (" [Confirm] ");
  67.     gather (answer, sizeof (answer));
  68.     return (prefix ("yes", answer) ? TRUE : FALSE);
  69. }
  70.  
  71. /* preliminary exit routine to clean up draft file */
  72. s_exit( xcode )
  73. int xcode;
  74. {
  75.     if( xcode == 0 || !body )
  76.         unlink(drffile);
  77.     unlink( tmpdrffile );
  78.     exit( xcode );
  79. }
  80.